#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string>
#include "common.hpp"
#include <unistd.h>
int main()
{
    int fd = open(FIFO_FILE,O_WRONLY | O_TRUNC);
    if(fd < 0) 
    {
        std::cout << "open error" << std::endl;
        return 2;
    }
    while(true)
    {
        std::cout << "Please Enter" << std::endl;
        std::string message;
        std::cin >> message;
        
        int n = write(fd,message.c_str(),message.size());
    }
    close(fd);
    return 0;
}